import { ProjectSpecification } from "@/mdesign-lib/mdesign-app.umd.js";
import { CreateProjectItem, CustomSystemConfig } from "./customSystemConfigTypes";
import { themeConfigModel } from "@/config/themeConfig";
import { isEdu, isTrialVersion } from "@/mdesign-lib/mdesign-app.umd.js";

const theme = themeConfigModel.getThemeConfig();
export const config: CustomSystemConfig = {
  hideModelLibrary: false,
  hideSeatLicense: isEdu,
  hideCowork: isTrialVersion,
  theme: {
    rootStyle: {
      "--theme-background-color": "#3F4AA6",
      "--background-color-active": "#7177CC",
      "--md-frame-title-bg-color": "#3F4AA6",
      "--md-toolbar-bg-color": "#ecf4ff",
      "--md-tab-bg-color": "#e6f0ff",
      "--md-special-text-color": "#fff",
      "--md-theme-color": "#1890ff"
    },
    createProject: [
      {
        id: 1,
        name: "标准项目",
        attrTipType: "createProject",
        projectSpecification: ProjectSpecification.SYSML,
        standard: "SysML v1.6",
        icon: "statics/images/mainpage/iconmx.png"
      },
      {
        id: 2,
        name: "UAF项目",
        attrTipType: "UAF Project",
        projectSpecification: ProjectSpecification.UAF,
        standard: "UAF v1.2",
        icon: "statics/arch/theme/DoDAF2.0.png",
        modifyModels: false
      },
      {
        id: 3,
        name: "UAF模板项目",
        attrTipType: "UAF Project",
        projectSpecification: ProjectSpecification.UAF,
        standard: "UAF v1.2",
        icon: "statics/arch/theme/DoDAF2.0.png",
        templatePath: "arch/projectTemplate/UAF-project-template-1.md3",
        modifyModels: true
      },
      {
        id: 4,
        name: "DoDAF项目",
        attrTipType: "DoDAF Project",
        projectSpecification: ProjectSpecification.DODAF,
        standard: "DoDAF v2.0",
        icon: "statics/arch/theme/DoDAF2.0.png",
        modifyModels: false
      },
      {
        id: 5,
        name: "DoDAF模板项目",
        attrTipType: "DoDAF Project",
        projectSpecification: ProjectSpecification.DODAF,
        standard: "DoDAF v2.0",
        icon: "statics/arch/theme/DoDAF2.0.png",
        templatePath: "arch/projectTemplate/DoDAF-project-template-1.md3",
        modifyModels: true
      },
      {
        id: 6,
        name: "UPDM项目",
        attrTipType: "UPDM Project",
        projectSpecification: ProjectSpecification.UPDM,
        standard: "UPDM 2",
        icon: "statics/arch/theme/DoDAF2.0.png",
        modifyModels: false
      }
    ],
    introduction: {
      title: theme.systemName,
      image: "statics/theme/m-design/product-introduction.png",
      contentPaddingR: "267px"
    },
    recentProjects: {
      title: "欢迎使用M-Design，建模让世界更清晰",
      class: ""
    },

    launch: {
      img: "statics/theme/m-design/launch-bg.png",
      top: ""
    },
    login: {
      img: "statics/theme/m-design/login-bg.png"
    },
    videoCourseList: {
      img: "statics/theme/m-design/video-course-list.png"
    },
    industryCaseList: {
      img: "statics/theme/m-design/industry-case-list.png"
    },
    about: {
      img: "statics/theme/m-design/about-bg.svg",
      support: ""
    },
    windowBar: {
      img: "statics/theme/m-design/topbar-logo.svg"
    },
    newGraph: {
      img: "statics/theme/m-design/new-graph.svg"
    }
  },
  website: "http://www.mbse.com.cn/",
  otherProduct: [
    { img: "statics/images/draw/otherProductMRequire.png", title: "M-Require", desc: "需求管理系统", content: "projectDec.Require" },
    // { img: 'statics/images/draw/otherProductMArch.png', title: 'M-Arch', desc: 'UAF体系架构建模工具', content: "projectDec.Arch" },
    { img: "statics/images/draw/otherProductMArch.png", title: "M-Design", desc: "SysML系统建模与仿真工具", content: "projectDec.Design" },
    {
      img: "statics/images/draw/otherProductMReliability.png",
      title: "M-Reliability",
      desc: "可靠性分析工具",
      content: "projectDec.Reliability"
    },
    { img: "statics/images/draw/otherProductMLinker.png", title: "M-Linker", desc: "数字化集成平台", content: "projectDec.Linker" },
    { img: "statics/images/draw/otherProductMCowork.png", title: "M-Cowork", desc: "云协同设计中台", content: "projectDec.Cowork" }
  ]
  // stereotypeConfigs: {
  //   'stId': {
  //     stId: 'stId',
  //     popmenu: {
  //       default: [],
  //       'diagramStId': [],
  //       'diagramStId2': []

  //     }
  //   }
  // }
};
/**
 * 对列表进行分类，根据权限加载有权限列表
 * @param list 传入列表
 * @returns 分类
 */
export function getCreateProjectFormSpecification(list: CreateProjectItem[]) {
  const result: { arch: CreateProjectItem[]; design: CreateProjectItem[] } = { arch: [], design: [] };
  for (let i = 0; i < list.length; i++) {
    switch (list[i].projectSpecification) {
      case ProjectSpecification.UPDM:
      case ProjectSpecification.DODAF:
      case ProjectSpecification.UAF: {
        result.arch.push(list[i]);
        break;
      }
      case ProjectSpecification.SYSML: {
        result.design.push(list[i]);
        break;
      }
    }
  }
  return result;
}
